package com.carleasoft.mps.cms.business.drug.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.carleasoft.mps.cms.business.drug.bean.entity.DrugOilManage;
import com.carleasoft.mps.cms.business.drug.bean.po.DrugOilManagePagePo;
import com.carleasoft.mps.cms.business.drug.service.DrugOilManageService;
import com.carleasoft.mps.core.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:油料和药品管理接口
 * @Author: fan
 */
@RestController
@RequestMapping("/drugOilManage")
public class DrugOilManageController {
    @Autowired
    private DrugOilManageService drugOilManageService;
    /**
     * 增加
     */
    @PostMapping("/add")
    public R add(@RequestBody DrugOilManage drugOilManage){
        return R.ok(drugOilManageService.add(drugOilManage));
    }
    /**
     * 编辑
     */
    @PostMapping("/edit")
    public R edit(@RequestBody DrugOilManage drugOilManage){
        return R.ok(drugOilManageService.edit(drugOilManage));
    }
    /**
     * 删除
     */
    @PostMapping("/delete")
    public R delete(@RequestBody DrugOilManage drugOilManage){
        return R.ok(drugOilManageService.delete(drugOilManage));
    }
    /**
     * 分页
     */
    @PostMapping("/pageQuery")
    public R<Page<DrugOilManage>> pageQuery(@RequestBody DrugOilManagePagePo drugOilManagePagePo){
        return R.ok(drugOilManageService.pageQuery(drugOilManagePagePo));
    }
    /**
     * 列表
     */
    @PostMapping("/list")
    public R<List<DrugOilManage>> queryList(@RequestBody DrugOilManage drugOilManage){
        return R.ok(drugOilManageService.queryList(drugOilManage));
    }
    /**
     * 详情
     */
    @PostMapping("/detail")
    public R<DrugOilManage> detail(@RequestBody DrugOilManage drugOilManage){
        return R.ok(drugOilManageService.detail(drugOilManage));
    }


}
